import Vue from 'vue'
import VueRouter from 'vue-router'
// import VueRouter from '../wtRouter'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/AboutView.vue'),
    children: [
      {
        path: 'a', // 这里有 / 就是根路径了，不是子路径
        component: {
          render: h => <h1>aaaa</h1>
        }
      },
      {
        path: 'b',
        component: {
          render: h => <h1>bbbb</h1>
        }
      }
    ]
  },
  {
    path: '/ant-table',
    name: 'antTable',
    component: () =>
      import(
        /* webpackChunkName: "antTable" */ '../views/003-ant-table/index.vue'
      )
  },
  {
    path: '/th',
    name: 'th',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/002-tonghang/index.vue')
  },
  {
    path: '/ol-map',
    name: 'olMap',
    component: () =>
      import(
        /* webpackChunkName: "olMap" */ '../views/005-openlayers/index.vue'
      )
  },
  {
    path: '/three',
    name: 'three',
    component: () =>
      import(/* webpackChunkName: "three" */ '../views/006-three/index.vue')
  },
  {
    path: '/svg',
    name: 'svg',
    component: () =>
      import(/* webpackChunkName: "svg" */ '../views/007-svg/index.vue')
  },
  {
    path: '/aq',
    name: 'aq',
    component: () =>
      import(
        /* webpackChunkName: "olMap" */ '../views/005-openlayers/index2.vue'
      )
  }
]

const router = new VueRouter({
  routes
})

export default router
